<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="icon" href="<%=$assets_server_url%>/images/favicon.ico" type="image/x-icon" />
    <title><%=yield :page_title%></title>
    <%= stylesheet_link_tag 'style', :media => 'all' %>
    <%= stylesheet_link_tag 'facebox', :media => 'all' %>
    <%= javascript_include_tag :defaults %>
    <%= javascript_include_tag "jquery.validate.js" %>
    <%= javascript_include_tag "tools.js" %>
    <%= javascript_include_tag "facebox.js" %>
    <%=yield :javascript_include%>
  </head>
  <body>
    <div  id="wrapper">
      <div id="head">
        <div id="logo">
          <a href="/"><%= image_tag 'logo.gif' %></a>
        </div>
        <div id="head_body">
          <div class="login_helper common_link">
            <%unless current_user.nil?%>
              <%=  link_to current_user.nickname ,user_path(current_user)%>
            <%else%>
              <%=link_to "登录",login_path%>
            <%end%>
            &nbsp;|&nbsp;
            <%unless current_user.nil?%>
              <%=link_to "注销",logout_path%>
            <%else%>
              <%=link_to "注册",signup_path%>
            <%end%>
            &nbsp;|&nbsp;<a href="javascript:;" onClick="addCookie('<%=$index_server_url%>','大满足日本语')" >加入收藏</a>
            &nbsp;|&nbsp;<a href="javascript:;" onClick="setHomepage('<%=$index_server_url%>')" >设为首页</a></span>
          </div>
          <div id="globalnav">
            <ul>
              <li class="common_link">
                <a href="#">首页</a>
              </li>
              <li class="common_link">
                <%=link_to "用户中心",user_path(current_user)%>
              </li>
              <li class="selected">
                <%=link_to "课程中心"%>
              </li>
            </ul>
          </div>
          <div class="search"></div>
        </div>
      </div>
      <div id="main_body">
        <div id="show_course_pannel">
          <div class="top">
            <span class="thumbnail"> <%=image_tag "course_image.gif"%> </span>
            <span class="study_button">
              <a href="#">开始学习</a>
            </span>
            <div class="info">
              <h6 class="link_brown"><%= link_to @course.title,course_path(@course) %></h6>
              <div class="course_info">
                <span class="total_count"><%= @course.items_count%></span>个单词 |
                <span class="completed_count">0</span>个已学完 |
                <span class="people_count">0</span>人在学
                <p>
                  <span class="favorate"> <a href="#" title="收藏课程"></a></span>
                  <span class="add_article"><a href="#" title="添加文章"></a></span>
                  <span class="add_video"><a href="#" title="添加视频"></a></span>
                </p>
              </div>
            </div>
          </div>
          <div id="left_side">
            <div class="bar">
              <div class="author">
                <h6>创建者</h6>
                <%= user_image_tag(current_user,"small") %>
                <span><%= current_user.nickname %></span>
              </div>
            </div>
            <div class="bar">
              <div class="description">
                <h6>课程的描述</h6>
                <p><%= @course.description %></p>
              </div>
            </div>
          </div>
          <div id="right_side">
            <%=yield%>
          </div>
        </div>
      </div>
      <%if RAILS_ENV == 'production'%>
        <%= javascript_include_tag "webanalytics.js" %>
      <%end%>
      <%= render(:partial => "common/footer")   %>
    </div>
  </body>
</html>